package com.itheima03.proxy;

public interface UserService2 {
    void deleteUser(Integer id);
    void addUser(Integer id);
}
class UserService2Impl implements UserService2{
    @Override
    public void deleteUser(Integer id) {
        System.out.println("根据id删除用户");
    }

    @Override
    public void addUser(Integer id) {

    }
}
//静态代理 : 代理类
class UserService2Proxy implements UserService2{
    UserService2 userService2;
    public UserService2Proxy(UserService2 userService2){
        this.userService2 = userService2;
    }
    @Override
    public void deleteUser(Integer id) {
        userService2.deleteUser(id);
    }

    @Override
    public void addUser(Integer id) {

    }
}
